﻿using System;
using System.Collections.Generic;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Text;
using System.Xml;
using System.Data;

using Gift.DAL;
using Gift.WebApp;
using System.Collections;

public partial class cn_UserControl_frend_link : System.Web.UI.UserControl
{
    // Fields
    readonly DALFrendLink theFrendLink = new DALFrendLink();
    protected string moduleSetXmlPath = "/cn/xml/module_set.xml";

    // Methods
    protected StringBuilder FrendLinkBins()
    {
        StringBuilder builder = new StringBuilder();
        try
        {
            XmlDocument document = new XmlDocument();
            document.Load(base.Server.MapPath(this.moduleSetXmlPath));
            XmlElement element = document.SelectSingleNode("set/friendly_link") as XmlElement;
            if (!(element.GetAttribute("isShow") == "true"))
            {
                return builder;
            }
            DataTable frendLink = this.theFrendLink.GetFrendLink();
            builder.AppendLine("<div class=\"links\">");
            builder.AppendLine("<h6 class=\"at\">" + element.GetAttribute("cn_title") + "<span>" + element.GetAttribute("en_title") + "</span></h6>");
            builder.AppendLine("<div class=\"infiniteCarousel\">");
            builder.AppendLine("<div class=\"wrapper\">");
            builder.AppendLine("<ul>");
            foreach (DataRow row in frendLink.Rows)
            {
                builder.AppendLine(string.Concat(new object[] { "<li><a href=\"", row["linkUrl"], "\" target=\"_blank\"><img alt=\"", row["linkName"], "\" src=\"", row["linkLogo"], "\" /></a></li>" }));
            }
            builder.AppendLine("</ul>");
            builder.AppendLine("</div>");
            builder.AppendLine("</div>");
            builder.AppendLine("<script type=\"text/javascript\" src=\"/script/js/indexmarque/marque.js\"></script>");
            builder.AppendLine("</div>");
        }
        catch
        {
        }
        return builder;
    }

    protected void Page_Load(object sender, EventArgs e)
    {
    }

}